import request from '@/utils/request'

export function queryUmsRoleList(params) {
    return request({
      url:'webApi/admin/role/list',
      method:'get',
      params:params
    })
}

export function listAllUmsRole() {
    return request({
        url:'webApi/admin/role/listAll',
        method:'get'
    })
}

export function listMenuByRole(roleId) {
    return request({
      url:'webApi/admin/role/listMenu/' + roleId,
      method:'get'
    })
}

export function listResourceByRole(roleId) {
    return request({
      url:'webApi/admin/role/listResource/' + roleId,
      method:'get'
    })
}

export function allocUmsRoleMenu(params) {
    return request({
      url:'webApi/admin/role/allocMenu',
      method:'post',
      params: params
    })
}

export function allocUmsRoleResource(params) {
    return request({
      url:'webApi/admin/role/allocResource',
      method:'post',
      params: params
    })
}


export function createUmsRole(data) {
    return request({
        url:'webApi/admin/role/add',
        method:'post',
        data:data
    })
}

export function updateUmsRole(id, data) {
    return request({
        url:'webApi/admin/role/update/'+id,
        method:'post',
        data:data
    })
}

export function deleteUmsRole(id) {
    return request({
        url:'webApi/admin/role/delete/' + id,
        method:'delete',
    })   
}